package com.lottery.im.module.setting.ui;

import android.graphics.Bitmap;
import android.widget.ImageView;
import butterknife.BindView;
import butterknife.OnClick;
import com.lottery.im.R;
import com.lottery.im.api.Api;
import com.lottery.im.base.BaseSwipeFragment;
import com.lottery.im.base.BaseView;
import com.lottery.im.module.setting.presenter.SharePresenter;
import com.uuzuche.lib_zxing.activity.CodeUtils;

public class ShareToFriendFragment extends BaseSwipeFragment implements BaseView {
  @BindView(R.id.img_qrc) ImageView imgQrc;

  @Override protected int getLayoutResId() {
    return R.layout.fragment_share_friend;
  }

  @Override protected void initPresenter() {
    presenter = new SharePresenter(getActivity(), this, this);
    presenter.init();
  }

  @Override public void initView() {
    Bitmap bitmap = CodeUtils.createImage(Api.downloadAddress, 138, 138, null);
    imgQrc.setImageBitmap(bitmap);
  }

  @OnClick(R.id.img_close) public void onViewClicked() {
    popBackStack();
  }
}
